package com.competitions.videoedithelper.controller;

import com.alibaba.fastjson.JSONObject;
import com.competitions.videoedithelper.entity.ResponseModel;
import com.competitions.videoedithelper.service.impl.TextToSpeechServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Mapler
 */
@CrossOrigin
@RestController
@RequestMapping(value = "/tts")
public class TextToSpeechController {
    private TextToSpeechServiceImpl iTextToSpeechServiceImpl;

    @Autowired
    public TextToSpeechController(TextToSpeechServiceImpl iTextToSpeechServiceImpl) {
        this.iTextToSpeechServiceImpl = iTextToSpeechServiceImpl;
    }

    @RequestMapping(value = "/getVoice",method = RequestMethod.POST)
    public ResponseModel textToSpeech(@RequestBody JSONObject data){
        return iTextToSpeechServiceImpl.textToSpeech(data);
    }
}
